//
//  LoadingViewController.swift
//  yunshang
//
//  Created by zw on 2019/5/29.
//  Copyright © 2019 zw. All rights reserved.
//

import UIKit
import RxCocoa
import RxSwift
class LoadingViewController: BaseViewController {

    let disposeBag = DisposeBag()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        let token = userDefaults.object(forKey: kTOKEN) as? String
        if token != nil{
            perform(#selector(delayAutologin), with: nil, afterDelay: 0.3)
        }else{
            perform(#selector(login), with: nil, afterDelay: 1.0)
        }
    }
    
    @objc func delayAutologin(){
        NotificationCenter.default.post(name: NSNotification.Name(rawValue: kLOGIN_SUCCESS), object: nil)
    }
    
    @objc func login(){
        NotificationCenter.default.post(name: NSNotification.Name(rawValue: kLOGOUT), object: nil)
    }
    


}
